"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.use = use;

require("core-js/modules/es.object.to-string.js");

require("reflect-metadata");

function use(middleware) {
  return function (target, key) {
    var middlewares = Reflect.getMetadata('middlewares', target, key) || [];

    if (middlewares.length) {
      middlewares.push(middleware);
    } else {
      middlewares = [middleware];
    }

    Reflect.defineMetadata('middlewares', middlewares, target, key);
  };
}